﻿
@{
    ViewData["Title"] = "GetRoom";
    Layout = null;
}



<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
<head>
    <title>H+ 后台主题UI框架 - 基础表格</title>

    <link href="~/BootstrapS/css/bootstrap.min14ed.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/font-awesome.min93e3.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/animate.min.css" rel="stylesheet" />
    <link href="~/BootstrapS/css/style.min862f.css" rel="stylesheet" />
    <script src="~/vue/axios.min.js"></script>
    <script src="~/vue/qs.min.js"></script>
    <script src="~/vue/vue.min.js"></script>
</head>

<body class="gray-bg">
    <div>
        <div class="wrapper wrapper-content animated fadeInRight" id="vueContent">
            <div class="row">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <input type="text" v-model="roomModel.name" placeholder="请输入关键词" class="input-sm form-control" style="width:180px;height:34px">
                        <button class="btn btn-info " v-on:click="queryRoom" type="button" style="margin-left:190px;margin-top:-48px">
                            <i class="fa fa-paste"></i> 查询
                        </button>
                        <button class="btn btn-info " href="/Rooms/AddRoom" type="button" style="margin-left:1100px;margin-top:-48px" data-toggle="modal" data-target="#myModal2">
                            <i class="fa fa-paste"></i> 添加病房
                        </button>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>病房编号</th>
                                    <th>病房类型</th>
                                    <th>病人姓名</th>
                                    <th>分配日期</th>
                                    <th>出院日期</th>
                                    <th>医生姓名</th>
                                    <th>当前状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="item in Room">
                                    <td>{{item.roomIntensive_Number}}</td>
                                    <td>{{item.roomType_Name}}</td>
                                    <td>{{item.patient_Name}}</td>
                                    <td>{{item.roomIntensive_TimeBegin}}</td>
                                    <td>{{item.roomIntensive_TimeEnd}}</td>
                                    <td>{{item.doctor_Name}}</td>
                                    <td>{{item.roomIntensive_State}}</td>
                                    <td>
                                        <button class="btn btn-info " href="/Rooms/UptRooms" type="button" data-toggle="modal" v-on:click="UptRooms(item.roomIntensive_Id)" data-target="#myModal3">
                                            <i class="fa fa-paste"></i> 编辑病房
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!--分页-->
                        <div class="btn-group" style="margin-left:45%">
                            <button type="button" class="btn btn-white">
                                <i class="fa fa-chevron-left"></i>
                            </button>

                            <button type="button" class="btn btn-white">
                                <i class="fa fa-chevron-right"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content animated flipInY" >

                </div>
            </div>
        </div>


        <div class="modal inmodal" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content animated flipInY">
                    
                </div>
            </div>
        </div>

    </div>
</body>
</html>
<script src="~/BootstrapS/js/jquery.min.js"></script>
<script src="~/BootstrapS/js/bootstrap.min.js"></script>
<script src="~/BootstrapS/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="~/BootstrapS/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="~/BootstrapS/js/plugins/layer/layer.min.js"></script>
<script src="~/BootstrapS/js/hplus.min.js"></script>
<script src="~/BootstrapS/js/contabs.min.js"></script>
<script src="~/BootstrapS/js/plugins/pace/pace.min.js"></script>

<script>
    new Vue({
        el: '#vueContent',
        data() {
            return {
                Room: null,
                roomModel: {
                    name: ""
                },
            }

        },
        mounted() {

            function getroom() {
                return axios
                    .get('/Rooms/GetRooms')
            }
            
            axios.all([getroom()])
                .then(axios.spread((Rooms, infos) => {
                    this.Room = Rooms.data;
                }))
                .catch(err => {
                    console.log(err);
                })
        },

        methods: {
           
            queryRoom: function () {
                axios
                    .get('/Rooms/GetRooms', {
                        params: { name: this.roomModel.name }
                    })
                    .then(response => (this.Room = response.data))
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            UptRooms: function (pid) {
                sessionStorage["pid"] = pid;
            }
        }


    });
</script>
